/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.active;

import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import info.peigen.hotpot.component.gateway.dianlan.facade.enums.DianlanRemoteStopChargeFailReason;
import info.peigen.hotpot.component.gateway.dianlan.facade.enums.DianlanSuccessSign;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BCD;
import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.ENUM;

/**
 * <b>(DianlanRemoteStopChargeResponse)</b>
 * <p>
 * 远程控制停机-应答
 * 远程停止充电命令回复，平台发送 0x36 后即关闭订单，接收到停机指令后设备务必保证停机。
 * 帧类型码 0x35
 * 序列号域 0003
 * 数据长度 0E(14)
 * 帧校验域 907E
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/11
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanRemoteStopChargeResponse {
    /** 桩编码 */
    @DianlanProtocol(length = 7, start = 0, end = 7, dataType = BCD)
    String                            stubNo;
    /** 充电枪号 */
    @DianlanProtocol(length = 1, start = 7, end = 8, dataType = BCD)
    String                            chargingPortNo;
    /** 停止结果 */
    @DianlanProtocol(length = 1, start = 8, end = 9, dataType = ENUM)
    DianlanSuccessSign                stopResult;
    /** 失败原因 */
    @DianlanProtocol(length = 1, start = 9, end = 10, dataType = ENUM)
    DianlanRemoteStopChargeFailReason failReason;
}